# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=b3sum
pkgver=0.3.6
pkgrel=0
pkgdesc="Command line implementation of the BLAKE3 hash function"
url="https://blake3.io"
arch="all !s390x !armhf !mips !mips64" # armhf: 'vaddq_u32': target specific option mismatch
license="CC0-1.0 OR Apache-2.0"
makedepends="cargo"
source="b3sum-$pkgver.tar.gz::https://crates.io/api/v1/crates/b3sum/$pkgver/download"

case "$CARCH" in
	arm*) _features="neon" ;;
esac

build() {
	cargo build --release --locked --no-default-features ${_features:+--features="$_features"}
}

check() {
	cargo test --release --locked --no-default-features ${_features:+--features="$_features"}
}

package() {
	cargo install --path . --root="$pkgdir/usr" --no-default-features ${_features:+--features "$_features"}
	rm "$pkgdir"/usr/.crates.toml
}

sha512sums="3e34907d31d59f76d00d81c31796a7baee7c9bb2825bf72209ec37e71cb9c7a3c593b00a2179a3e92d1d08dc60e73c80868049c0beed62e76ac04dc003e27337  b3sum-0.3.6.tar.gz"
